home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / clipscrl.zip / SCRL&PAN.PRG < prev   
Text File  |  1993-01-04  |  3KB  |  94 lines

  1. *=============================================================================
  2. *
  3. * Filename: SCRL&PAN.PRG
  4. * Author..: Tim Shriver; Softech International, Inc. (301) 890-4054
  5. * Address.:              14241 Ballinger Terrace
  6. *                        Laurel, MD  20707
  7. * Date....: November 18, 1986
  8. * Notice..: This program is donated as Shareware.  Scrl&Pan works and I'm 
  9. *           sure it could be written better.  I am not an assembly programmer
  10. *           and would like to here any suggestions for improving the code.  
  11. *           If you find these routines to be helpful please send $5.00 to 
  12. *           the address shown above.  Look for other clipper utilities on this
  13. *           BBS from Softech in the near future.  Thank you for your support. 
  14. * Notes...: These functions are already compiled, simply plink86 or link the
  15. *           two files SCRL&PAN.OBJ and CLIPSCRL.OBJ.
  16. *    
  17. *  Syntax: SCRLUP or DOWN (<expN1>,<expN2>,<expN3>,<expN4>,<expN5>,<expN6>)
  18. *  Parms : expN1: Number of lines to scroll up or down
  19. *          expN2: Row of upper left corner of scroll 
  20. *          expN3: Col of upper left corner of scroll 
  21. *          expN4: Row of lower right corner of scroll 
  22. *          expN5: Col of lower right corner of scroll 
  23. *          expN6: Attribute to be used on blank lines at bottom of scroll
  24.  
  25. clear
  26. external SCRLUP, SCRLDOWN
  27. * create and init the blank area which is appears on the sides after a pan
  28. nullarea = ''
  29. for x = 1 to 10
  30.    nullarea = nullarea + chr(32) + chr(7)
  31. next
  32. * fill the screen with test data for demo 
  33. for x = 0 to 22
  34.    for y = 1 to 79
  35.       ?? chr(y+x+33)
  36.    next 
  37.    ?
  38. next
  39. * begin demo loop
  40. q1 = 1
  41. do while q1 <> 5
  42.    @ 24,10 prompt 'Left'
  43.    @ 24,20 prompt 'Right'
  44.    @ 24,30 prompt 'Up'
  45.    @ 24,40 prompt 'Down'
  46.    @ 24,50 prompt 'Quit'
  47. * lines to scroll
  48.    n1 = 1
  49. * coordinate of window to scroll
  50.    n2 = 5
  51.    n3 = 5
  52.    n4 = 18
  53.    n5 = 75
  54. * attribute of new line
  55.    n6 = 7
  56. * get user option
  57.    menu to q1
  58.    do case
  59.       case q1 = 1
  60. * pan left
  61.          save screen to oldscreen
  62. * init newscreen mem var
  63.          newscreen = ''
  64. * load newscreen with line portion of screen to be shifted + nullarea
  65. * only 23 lines so we do not disturb the prompts at bottom of screen 
  66.          for x = 1 to 23
  67.             temp = ((x-1) * 160) + 21 
  68. * time intensive routine, needs to be recoded in assembler or C
  69.             newscreen = newscreen + substr(oldscreen,temp,140) + nullarea
  70.          next
  71. * load remaining bottom of screen as is into newscreen
  72.          newscreen = newscreen + substr(oldscreen,3681,320)
  73. * display new screen
  74.          restore screen from newscreen
  75.       case q1 = 2
  76. * pan right
  77.          save screen to oldscreen
  78.          newscreen = ''
  79.          for x = 1 to 23
  80.             temp = ((x-1) * 160) + 1 
  81.             newscreen = newscreen + nullarea + substr(oldscreen,temp,140)
  82.          next
  83.          newscreen = newscreen + substr(oldscreen,3681,320)
  84.          restore screen from newscreen
  85.       case q1 = 3
  86. * scroll up
  87.          do SCRLUP with n1,n2,n3,n4,n5,n6
  88.       case q1 = 4
  89. * scroll down
  90.          do SCRLDOWN with n1,n2,n3,n4,n5,n6
  91.    endcase
  92. enddo         
  93. release all
  94. quit